In a long term evolution (LTE) system in the prior art, if a user equipment (UE) in connecting state detects that quality of signal in a source cell is poor, the base station of the source cell (hereinafter referred as source base station) makes the following handover preparations after receiving a measurement report from the UE. The source base station derives a key_A according to a target cell's physical cell identifier (ID), sends the key_A to the base station X of a target cell A (hereinafter referred as target base station), and sends a handover command to the UE. If the UE cannot receive the handover command in case of radio link failure (RLF), the UE re-selects a proper cell and initiates a radio resource control (RRC) connection reestablishment procedure to resume the service.
In the technical solution in the prior art, when the base station of a target cell B that the UE attempts to access through the connection reestablishment procedure is the same as the base station of the target cell A, the UE derives a key_B by using the physical cell ID of the target cell B, and encrypts messages that the UE sends to the base station X by using the key_B; the base station X decrypts the messages sent from the UE by using the key_A according to context information of the UE. Thus, the keys used by the UE and the base station X are inconsistent, which leads to a failure of communication between the UE and the base station.